﻿using Base.EFCore;
using Base.EFCore.Entity;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace WebApp.Controller
{
    [Route("api/[controller]")]
    [ApiController]
    public class MaterialController : ControllerBase
    {
        protected EFContext _context { get; set; }

        public MaterialController(EFContext context)
        {
            _context = context;
        }


        [HttpGet("Get")]
        public IActionResult Get()
        {
            var p = _context.Materials.Add(new Material { Code = "0001", Name = "盒子" });
            _context.SaveChanges();
            return Ok();
        }
    }
}
